# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sqlpat
pkgver=1.0.1
pkgrel=3
pkgdesc='This tool should be used to audit the strength of Microsoft SQL Server passwords offline.'
url='http://www.cqure.net/wp/sqlpat/'
groups=('blackarch' 'blackarch-cracker')
license=('GPL')
depends=('openssl')
arch=('x86_64' 'aarch64')
source=("http://www.cqure.net/tools/sqlbf-all-src-$pkgver.zip")
sha512sums=('bb72f67eb6348d06232da0f1438b4bf4ab59caeb0a0a0741cdb447db2aa0b438c885ad843dad83e86885f2d1aab25afd1caceeb5bb4cc44594970180fe84db97')

build() {
  cd sqlbf

  gcc $CFLAGS bf.c crypto.c sqlbf.c -o sqlbf -I include/ -lpthread -lm -lssl \
    -lcrypto
}

package() {
  cd sqlbf

  install -Dm 755 sqlbf "$pkgdir/usr/bin/sqlbf"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.wri
}

